﻿<!--_meta 作为公共模版分离出去-->
<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
	<meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
	<link rel="stylesheet" href="/layui.css"  media="all">
	<link rel="stylesheet" type="text/css" href="/static/h-ui/css/H-ui.min.css" />
	<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/H-ui.admin.css" />
	<link rel="stylesheet" type="text/css" href="/lib/Hui-iconfont/1.0.8/iconfont.css" />
	<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/skin/default/skin.css" id="skin" />
	<link rel="stylesheet" type="text/css" href="/static/h-ui.admin/css/style.css" />



<title>新建网站角色 - 管理员管理 - H-ui.admin v3.1</title>
<meta name="keywords" content="H-ui.admin v3.1,H-ui网站后台模版,后台模版下载,后台管理系统模版,HTML后台模版下载">
<meta name="description" content="H-ui.admin v3.1，是一款由国人开发的轻量级扁平化网站后台模板，完全免费开源的网站后台管理系统模版，适合中小型CMS后台系统。">
	<meta charset="utf-8">
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">


	<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
	<script type="text/javascript" charset="utf-8" src="/ueditor.config.js"></script>
	<script type="text/javascript" charset="utf-8" src="/ueditor.all.js"> </script>
	<script type="text/javascript" charset="utf-8" src="/lang/zh-cn/zh-cn.js"></script>
	<link rel="stylesheet" type="text/css" href="/layui.css" />
</head>
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 新增资讯 </nav>
<form class="layui-form layui-form-pane" method="post" action="/addContent">
	<input type="hidden" id="coin_id" name="coin_id">
	<input type="hidden" id="exchange_id" name="exchange_id">
	<input type="hidden" id="program_id" name="program_id">
	<textarea id="con_article" name="con_article" style="display: none"></textarea>

	<div class="layui-form-item">
		<label class="layui-form-label">选择币种</label>
		<div class="layui-input-block">
			<select name="" lay-filter="coin" lay-search="">
				<option value="">请选择币种</option>
				<option th:each="coinTemplateData:${coinTemplateDataList}" th:value="${coinTemplateData.cid}" th:text="${coinTemplateData.selectCoin}" ></option>
			</select>
		</div>
	</div>

	<div class="layui-form-item">
		<label class="layui-form-label">选择交易所</label>
		<div class="layui-input-block">
			<select name="" lay-filter="exchange" lay-search="">
				<option value="">请选择交易所</option>
				<option th:each="exchange:${exchangeList}" th:value="${exchange.eid}" th:text="${exchange.ename}" ></option>
			</select>
		</div>
	</div>


	<div class="layui-form-item">
		<label class="layui-form-label">选择栏目</label>
		<div class="layui-input-block">
			<select name="" lay-filter="program">
				<option value="">请选择栏目</option>
				<option th:each="program:${programList}" th:value="${program.program_id}" th:text="${program.program_name}" ></option>

			</select>
		</div>
	</div>


	<div class="layui-form-item">
		<label class="layui-form-label">资讯标题</label>
		<div class="layui-input-block">
			<input type="text" name="con_title" required  lay-verify="required" autocomplete="off"  class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">资讯来源</label>
		<div class="layui-input-block">
			<input type="text" name="con_addr" required  lay-verify="required" autocomplete="off"  class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">资讯作者</label>
		<div class="layui-input-block">
			<input type="text" name="con_author" required  lay-verify="required" autocomplete="off"  class="layui-input">
		</div>
	</div>
	<div class="layui-form-item">
		<label class="layui-form-label">发布时间</label>
		<div class="layui-input-block">
			<input type="text" name="format_time" id="test1" required  lay-verify="format_time" placeholder="请输入格式为2018-01-01 00:00:00的时间" autocomplete="off"  class="layui-input">
		</div>
	</div>
	<div class="layui-form-item layui-form-text">
		<label class="layui-form-label">资讯内容</label>
		<div id="editor" style="height:360px">
			<script type="text/javascript" charset="utf-8">      UE.getEditor('editor');</script>
		</div>
	</div>


	<div class="layui-form-item">
		<div id="button_relative" class="layui-input-block">
			<button class="layui-btn" lay-submit lay-filter="aa">立即提交</button>
			<button type="reset" class="layui-btn layui-btn-primary">重置</button>
		</div>
	</div>

</form>

<script type="text/javascript" src="/layui.js"></script>
<script type="text/javascript" src="/jquery.js"></script>
<script  th:inline="javascript" type="text/javascript">

	layui.use('laydate',function () {
		var laydate=layui.laydate;
		laydate.render({
			elem:'#test1',
			type:'datetime'
		});
    })


	  layui.use('form', function(){
      	var form = layui.form; //只有执行了这一步，部分表单元素才会自动修饰成功
          form.verify({
              format_time: function(value, item){ //value：表单的值、item：表单的DOM对象
                  if(!new RegExp("^[1-9]\\\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[1-2][0-9]|3[0-1])(\\s)((20|21|22|23|[0-1]?\\\d):[0-5]?\\\d:[0-5]?\\\d)$").test(value)){
                      return '时间格式不对';
                  }
              }
          });
      //但是，如果你的HTML是动态生成的，自动渲染就会失效
      //因此你需要在相应的地方，执行下述方法来手动渲染，跟这类似的还有 element.init();
      form.render();
      form.on('select(coin)', function(data){
          $("#coin_id").attr("value",data.value);
      });
      form.on('select(exchange)', function(data){
          $("#exchange_id").attr("value",data.value);
      });
      form.on('select(program)', function(data){
          $("#program_id").attr("value",data.value);
      });
      form.on('submit(aa)', function(data){
          if($("#coin_id").val()==""){
              $("#coin_id").attr("value",0)

          }
          if($("#exchange_id").val()==""){
              $("#exchange_id").attr("value",0)
          }
          if($("#program_id").val()==""){
              layer.msg('请选择内容栏目');
              return false;
		  }
          document.getElementById('con_article').innerHTML=UE.getEditor('editor').getContent();
      });

  });


</script>
<!--/请在上方写此页面业务相关的脚本-->
</body>
</html>